package itdfq.dfq.Structural_Patterns.daili;

/**
 * @Author GocChin
 * @Date 2021/5/3 14:27
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
public class PerProxy implements AbstractPer{
    private int mark = 0;

    private RealPer realPer = new RealPer();

    @Override
    public void shop() {
        if (mark==0){
            System.out.println("对不起，您不允许卖杜康酒");
        }else{
            realPer.shop();
        }

    }

    @Override
    public void purchase() {
        if (mark==0){
            System.out.println("对不起，您不允许去批发杜康酒");
        }else{
            realPer.purchase();
        }
    }

    @Override
    public void setMaek(int maek) {
        this.mark=maek;
    }
}
